<script setup lang="ts">

import {ref, watch} from "vue";
import PostUnit from "@/components/post/PostUnit.vue";
import {getPostApi} from "@/api/path/post";

const props = defineProps({
  id: String,
})
const postData = ref();
watch(() => props, (newValue) => {
  getPostApi(newValue.id).then(res => {
    if (res.errno == 1) {
      postData.value = res.post
    }
  })
},{deep: true, immediate: true})
</script>

<template>
  <post-unit :post="postData" :show-comment-box="false"></post-unit>
</template>

<style scoped>

</style>